package com.loong.mapper.impl;

import com.loong.mapper.TypeMapper;
import com.loong.pojo.Type;
import com.loong.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;

import java.util.List;

public class TypeMapperImpl implements TypeMapper {
    Logger logger = Logger.getLogger(TypeMapperImpl.class);
    @Override
    public List<Type> selectAll() {
        try (SqlSession sqlSession = MybatisUtils.getSqlSession()){
            TypeMapper mapper = sqlSession.getMapper(TypeMapper.class);
            return mapper.selectAll();
        }catch (Exception e){
            logger.error(e.getMessage());
            return null;
        }
    }
}
